package com.example.deepschool.Model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class Course {
	
	@Schema(description = "课程唯一标识ID")
	private Long id;
	
	@NotBlank(message = "课程名称不能为空")
	@Schema(description = "课程名称")
	private String name;
	
	@NotBlank(message = "课程简介不能为空")
	@Schema(description = "课程简介")
	private String description;
	
	@NotNull(message = "课程价格不能为空")
	@Schema(description = "课程价格")
	private double price;
	
	@NotNull(message = "是否开放资源标志不能为空")
	@Schema(description = "是否开放资源，1表示开放，0表示不开放")
	private Long isOpenResource;
	
	@Schema(description = "课程创建时间")
	private java.sql.Timestamp creationTime;
	
	@NotNull(message = "课程是否上线不能为空")
	@Schema(description = "课程是否上线，1表示已上线，0表示未上线")
	private Long isOnline;
	
	@Schema(description = "课程封面图片URL")
	private String coverImage;
	
	public Course ( String name, String description, double price, Long isOpenResource, Long isOnline ) {
		this.name = name;
		this.description = description;
		this.price = price;
		this.isOpenResource = isOpenResource;
		this.isOnline = isOnline;
	}
	
	public Course () {
	}
}
